package localedate01;

import java.time.LocalDate;

/*
  LocalDate的设置功能
       static LocalDate of(int year, int month, int dayOfMonth)

       LocalDate withYear(int year)  //设置指定日期的年

       LocalDate withMonth(int month)  //设置月

       LocalDate withDayOfYear(int dayOfYear) //设置这一年的第几天

       LocalDate withDayOfMonth(int dayOfMonth) //设置日
 */
public class LocalDateDemo02 {
    public static void main(String[] args) {
        //method01();

        LocalDate newDate = LocalDate.now().withYear(2015);
        System.out.println(newDate);

        LocalDate newDate2 = newDate.withMonth(3);
        System.out.println(newDate2);

        System.out.println(newDate2.withDayOfMonth(11));

        System.out.println(newDate2.withDayOfYear(32));

    }

    private static void method01() {
        System.out.println(LocalDate.now());
        LocalDate newDate = LocalDate.of(2016, 10, 23);//of方法可以设置指定的年月日
        System.out.println(newDate);
    }
}
